package com.elangzhi.ssm.model;

import com.elangzhi.ssm.model.base.BaseModel;

import java.text.SimpleDateFormat;
import java.util.Date;

public class ShopEvent  extends BaseModel {
    private Long id;

    /**
     *活动标题
     */
    private String title;

    /**
     *添加时间
     */
    private Date setTime;

    /**
     *开始时间
     */
    private Date beginTime;

    /**
     *结束时间
     */
    private Date endTime;

    /**
     *所属店铺ID
     */
    private Long shopId;

    /**
     *简介
     */
    private String intro;

    /**
     *类型
     * 1，限时优惠 打折
     */
    private Integer type;

    /**
     * 折扣力度百分比
     * 例如8.5折
     * 值为85
     */
    private Integer zheValue;

    /**
     * 活动内容
     */
    private String content;

    /**
     * 商品列表
     * 多个商品id之间用","分割
     */
    private String goodsList;


    //
    private String shopName;

    public ShopEvent(Long id, String title, Date setTime, Date beginTime, Date endTime, Long shopId, String intro, Integer type, Integer zheValue, String content, String goodsList) {
        this.id = id;
        this.title = title;
        this.setTime = setTime;
        this.beginTime = beginTime;
        this.endTime = endTime;
        this.shopId = shopId;
        this.intro = intro;
        this.type = type;
        this.zheValue = zheValue;
        this.content = content;
        this.goodsList = goodsList;
    }

    public ShopEvent() {
        super();
    }

    public String getShopName() {
        return shopName;
    }

    public void setShopName(String shopName) {
        this.shopName = shopName;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public Date getSetTime() {
        return setTime;
    }

    public void setSetTime(Date setTime) {
        this.setTime = setTime;
    }

    public Date getBeginTime() {
        return beginTime;
    }

    public String getBeginTime(String patt){
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat(patt);
        return simpleDateFormat.format(this.beginTime);
    }

    public void setBeginTime(Date beginTime) {
        this.beginTime = beginTime;
    }

    public Date getEndTime() {
        return endTime;
    }


    public String getEndTime(String patt){
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat(patt);
        return simpleDateFormat.format(this.endTime);
    }

    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }

    public Long getShopId() {
        return shopId;
    }

    public void setShopId(Long shopId) {
        this.shopId = shopId;
    }

    public String getIntro() {
        return intro;
    }

    public void setIntro(String intro) {
        this.intro = intro;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public Integer getZheValue() {
        return zheValue;
    }

    public void setZheValue(Integer zheValue) {
        this.zheValue = zheValue;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getGoodsList() {
        return goodsList;
    }

    public void setGoodsList(String goodsList) {
        this.goodsList = goodsList;
    }
}